package pers.dzk.fivelnarow.player;

import pers.dzk.fivelnarow.piece.Piece;
import pers.dzk.fivelnarow.piece.PieceType;

import java.awt.*;
import java.io.Serializable;
import java.util.List;

/**
 * @author 丁泽凯
 */
public abstract class Player implements Serializable {
    private String name;
    private boolean isMyTime;
    private List<Piece> pieceList;
    private PieceType pieceType;
    public Player(List<Piece> pieces,boolean order) {
        pieceList = pieces;
        name = pieceList.get(0).getCode()+"选手";
        pieceType = pieceList.get(0).getCode();
        this.isMyTime = order;
    }
    public Player(){}

    public int getCount(){
        return pieceList.size();
    }

    public boolean isMyTime() {
        return isMyTime;
    }

    public void setMyTime(boolean myTime) {
        isMyTime = myTime;
    }

    public String getName() {
        return "'"+name+"'";
    }

    public void setName(String name) {
        this.name = name;
    }

    public PieceType getPieceType() {
        return pieceType;
    }

    public List<Piece> getPieceList() {
        return pieceList;
    }

    public void setPieceList(List<Piece> pieceList) {
        this.pieceList = pieceList;
    }

    public void setPieceType(PieceType pieceType) {
        this.pieceType = pieceType;
    }

}
